@extends('base')

@section('content')
    <div class="layui-card">
        <div class="layui-card-body">
            <form class="layui-form" action="{{route('caiwu.invoice.store')}}" method="post">
                {{csrf_field()}}
                <div class="layui-form-item">
                    <label for="" class="layui-form-label">订单号</label>
                    <div class="layui-input-inline" style="width: 90px">
                        <button type="button" id="chose_order" class="layui-btn layui-btn-sm">点击选择</button>
                    </div>
                    <div class="layui-form-mid layui-word-aux">
                        <span id="project_tips"></span>
                    </div>
                    <input type="hidden" name="type_bind_id" value="0" id="type_bind_id">
                    <input type="hidden" name="num" value="" id="type_bind_num">
                </div>
                <div class="layui-form-item">
                    <label for="" class="layui-form-label">抬头类型</label>
                    <div class="layui-input-block">
                        <input type="radio" name="type" value="1" title="企业单位" checked>
                        <input type="radio" name="type" value="2" title="个人/非企业单位" >
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">公司名称</label>
                    <div class="layui-input-block">
                        <input type="text" name="name" lay-verify="required" placeholder="请输入" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">公司税号</label>
                    <div class="layui-input-block">
                        <input type="text" name="num" placeholder="请输入" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">发票金额</label>
                    <div class="layui-input-block">
                        <input type="number" name="money" lay-verify="required" value="" placeholder="请输入" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-input-block">
                        <button type="button" lay-submit lay-filter="go-close-refresh" class="layui-btn layui-btn-sm">确认</button>
                    </div>
                </div>
            </form>
        </div>
    </div>
@endsection

@section('script')
    <script>
        layui.use(['element', 'form', 'layer', 'table', 'upload', 'laydate', 'jquery'], function () {
            var $ = layui.jquery;
            var form = layui.form;
            var table = layui.table;
            var layer = layui.layer;
            var laydate = layui.laydate;

            $("#chose_order").click(function () {
                layer.open({
                    type: 2,
                    title: false,
                    shadeClose: true,
                    area: ["80%","80%"],
                    content: '{{route('api.choseOrder')}}',
                })
            })



        });
    </script>
@endsection

